#ifndef STATIC_PROCESSOR_H_
#define STATIC_PROCESSOR_H_
#include <mutex>
#include <string>

#include "common/perception_defs.h"
#include "postprocess/common/common_func.h"
#include "postprocess/common/common_var.h"
#include "postprocess/common/object_track.h"
#include "postprocess/matcher/matcher.h"
#include "postprocess/processor/base_processor.h"

class StaticProcessor final : public BaseProcessor {
 public:
  StaticProcessor() noexcept;
  StaticProcessor(StaticProcessor const &) = delete;
  StaticProcessor &operator=(StaticProcessor const &) = delete;
  StaticProcessor(StaticProcessor &&) = delete;
  StaticProcessor &operator=(StaticProcessor &&) = delete;
  virtual ~StaticProcessor();

  ///@brief init
  ///@param settings PostProcessorSettings
  /// @param err error message
  /// @return if no error return true, otherwise false
  void Init(PostProcessorSettings const &settings) noexcept;

  /// @brief do post process
  /// @param perceptionResult perception result
  /// @param err error message
  /// @return if no error return true, otherwise false
  bool Run(autodrive::perception::PerceptionResult &perceptionResult,
           std::string &err) noexcept;

  /// @brief return reference of ObjectTrackSet
  /// @return
  inline ObjectTrackSet &GetObjectTrackSet() { return object_tracks_; }

 private:
  ///@brief mutex , multi thread safe
  std::mutex mutex_;
  ///@brief init flag
  bool is_init_;
  /// @brief settings
  PostProcessorSettings settings_;
  /// @brief previous timestamp
  std::uint64_t pre_timestamp_;
  /// @brief initialize track
  bool track_initialization_flag_;
  /// @brief track prediction
  // autodrive::perception::fixed_array<TrackedObject, kMaxTrackerObjectNum>
  //     tracker_prediction_objects_;
  /// @brief hungarian matcher
  std::unique_ptr<Mathcer> matcher_;
  /// @brief tracker Set
  ObjectTrackSet object_tracks_;
};

#endif  // BASE_PROCESSOR_H_
